import os

def filelist(path):
    fs=[]
    for root,dirs , files in os.walk(path):
        print dirs
        for f in files :
            fs.append(os.path.join(root,f))
    return fs


'''
for root,dirs , files in os.walk('pics'):

    for f in files :
        print f
        os.rename(os.path.join(root,f),os.path.join(root,f)+'.jpg')
'''
